<template>
    <Table size="small" row-key="id" :columns="columns" :data="data"></Table>
</template>
<script>
    // import expandRow from './table-expand.vue';
    export default {
        // components: { expandRow },
        data () {
            return {
                columns: [
                    // {
                    //     type: 'expand',
                    //     width: 50,
                    //     render: (h, params) => {
                    //         return h(expandRow, {
                    //             props: {
                    //                 row: params.row
                    //             }
                    //         })
                    //     }
                    // },
                    {
                        title: '项目',
                        key: 'project',
                        tree: true
                    },
                    {
                        title: '诊室',
                        key: 'room'
                    },
                    {
                        title: '治疗人数',
                        key: 'PersonTime'
                    },
                    {
                        title: '治疗人次',
                        key: 'Number'
                    },
                    {
                        title: '治疗频率',
                        key: 'frequency'
                    },
                    {
                        title: '治疗量',
                        key: 'int'
                    },
                    {
                        title: '人均用量',
                        key: 'PTime'
                    },
                    {
                        title: '购买量',
                        key: 'purchase'
                    },
                    {
                        title: '人均购买',
                        key: 'perPurchase'
                    }
                ],
                data: [
                    {
                        project: '308',
                        room: '诊室汇总',
                        PersonTime: 265,
                        Number: 21,
                        frequency: '1.04',
                        int: 308,
                        PTime: '1.3',
                        purchase: 56,
                        perPurchase: '536',
                        children: [
                            {
                                project: '314',
                                room: '诊室汇总',
                                PersonTime: 265,
                                Number: 21,
                                frequency: '1.04',
                                int: 308,
                                PTime: '1.3',
                                purchase: 56,
                                perPurchase: '536'
                            }
                        ]
                    },
                    {
                        project: '311',
                        room: '诊室汇总',
                        PersonTime: 265,
                        Number: 21,
                        frequency: '1.04',
                        int: 308,
                        PTime: '1.3',
                        purchase: 56,
                        perPurchase: '536'
                    },
                    {
                        project: '药浴',
                        room: '诊室汇总',
                        PersonTime: 265,
                        Number: 21,
                        frequency: '1.04',
                        int: 308,
                        PTime: '1.3',
                        purchase: 56,
                        perPurchase: '536'
                    },
                    {
                        project: '熏蒸',
                        room: '诊室汇总',
                        PersonTime: 265,
                        Number: 21,
                        frequency: '1.04',
                        int: 308,
                        PTime: '1.3',
                        purchase: 56,
                        perPurchase: '536'
                    },
                    {
                        project: '注射',
                        room: '诊室汇总',
                        PersonTime: 265,
                        Number: 21,
                        frequency: '1.04',
                        int: 308,
                        PTime: '1.3',
                        purchase: 56,
                        perPurchase: '536'
                    },
                    {
                        project: '输液',
                        room: '诊室汇总',
                        PersonTime: 265,
                        Number: 21,
                        frequency: '1.04',
                        int: 308,
                        PTime: '1.3',
                        purchase: 56,
                        perPurchase: '536'
                    }
                ]
            }
        }
    }
</script>
<style lang="less" scoped>
    /deep/ .ivu-table-cell-tree {
        text-align: center;
        .ivu-icon {
            vertical-align: middle;
        }
    }
</style>
